/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="express_fee")
public class ExpressFee implements Serializable {
	public ExpressFee() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Express express;
	
	private cn.imvc.app.entities.Area area;
	
	private Integer first;
	
	private Integer firstPrice;
	
	private Integer additional;
	
	private Integer additionalPrice;
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_EXPRESSFEE_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_EXPRESSFEE_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 首重克
	 */
	public void setFirst(int value) {
		setFirst(new Integer(value));
	}
	
	/**
	 * 首重克
	 */
	public void setFirst(Integer value) {
		this.first = value;
	}
	
	/**
	 * 首重克
	 */
	@Column(name="first", nullable=true, length=10)	
	public Integer getFirst() {
		return first;
	}
	
	/**
	 * 首重价格
	 */
	public void setFirstPrice(int value) {
		setFirstPrice(new Integer(value));
	}
	
	/**
	 * 首重价格
	 */
	public void setFirstPrice(Integer value) {
		this.firstPrice = value;
	}
	
	/**
	 * 首重价格
	 */
	@Column(name="firstPrice", nullable=true, length=10)	
	public Integer getFirstPrice() {
		return firstPrice;
	}
	
	/**
	 * 续重克
	 */
	public void setAdditional(int value) {
		setAdditional(new Integer(value));
	}
	
	/**
	 * 续重克
	 */
	public void setAdditional(Integer value) {
		this.additional = value;
	}
	
	/**
	 * 续重克
	 */
	@Column(name="additional", nullable=true, length=10)	
	public Integer getAdditional() {
		return additional;
	}
	
	/**
	 * 续重价格
	 */
	public void setAdditionalPrice(int value) {
		setAdditionalPrice(new Integer(value));
	}
	
	/**
	 * 续重价格
	 */
	public void setAdditionalPrice(Integer value) {
		this.additionalPrice = value;
	}
	
	/**
	 * 续重价格
	 */
	@Column(name="additionalPrice", nullable=true, length=10)	
	public Integer getAdditionalPrice() {
		return additionalPrice;
	}
	
	public void setExpress(cn.imvc.app.entities.Express value) {
		this.express = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Express.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="expressId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Express getExpress() {
		return express;
	}
	
	public void setArea(cn.imvc.app.entities.Area value) {
		this.area = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Area.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="areaId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Area getArea() {
		return area;
	}
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("ExpressFee[ ");
			sb.append("Id=").append(getId()).append(" ");
			if (getExpress() != null)
				sb.append("Express.Persist_ID=").append(getExpress().toString(true)).append(" ");
			else
				sb.append("Express=null ");
			if (getArea() != null)
				sb.append("Area.Persist_ID=").append(getArea().toString(true)).append(" ");
			else
				sb.append("Area=null ");
			sb.append("First=").append(getFirst()).append(" ");
			sb.append("FirstPrice=").append(getFirstPrice()).append(" ");
			sb.append("Additional=").append(getAdditional()).append(" ");
			sb.append("AdditionalPrice=").append(getAdditionalPrice()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
